<?php
/**
 * 
 * Interface for components
 * 
 * @package WKernel
 *
 */
abstract class WK_Component {
	abstract public static function getInstance($config);
	abstract public function getCommand($name, $params = array());	
	
	public function getCmdInstance($name, $command_class, $command_file, $params){
		if(!class_exists($command_class))
			include $command_file;
		if(class_exists($command_class)) {
			$command = new $command_class ($params);
			return $command;
		}
		else {
			throw new WK_Error('Command ' . $this->getName() . '/' . $name . ' does not exists!', WERR_UNKNOWN_COMMAND);
		}
	}	
}